function multiply(array)
{
    // write code here
    var pre = []
    var next = []
    var res = []
    var n = array.length
    for(let i = 0;i < n;i++){
      if(i=== 0){
        pre[i] = 1
      }else{
        pre[i] = pre[i-1] * array[i-1]
      }
    }
    for(let i = n-1 ;i >= 0;i--){
      if(i === n-1){
        next[i] = 1
      }else{
        next[i] = next[i+1] * array[i+1]
      }
    }
    for(let i = 0;i < n ;i++){
      res[i] = pre[i] * next[i]
    }
    return res
}
module.exports = {
    multiply : multiply
};